/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.ekuma.epos.datalogic;

import cn.ekuma.data.dao.I_DataLogic;
import cn.ekuma.epos.module.Module;

import com.openbravo.bean.AppUser;
import com.openbravo.bean.AppUserState;
import com.openbravo.bean.CloseCash;
import com.openbravo.bean.Location;
import com.openbravo.data.basic.BasicException;
import com.openbravo.pos.bean.AppUserExt;
import com.openbravo.pos.bean.Resource;

import java.util.Date;
import java.util.List;

/**
 *
 * @author Administrator
 */
public interface I_DataLogicSystem extends I_DataLogic{

	Module findModuleById(String id) throws BasicException;
	
    void execChangePassword(String id,String newPassword) throws BasicException;

    void execDummy() throws BasicException;

    CloseCash findActiveCash(String sActiveCashIndex) throws BasicException;

    CloseCash findPeopleActiveCash(String sActiveCashIndex, int delay) throws BasicException;

    CloseCash findSystemCash(String cashName) throws BasicException;

    String findLocationName(String iLocation) throws BasicException;

    AppUser findPeopleByCard(String card) throws BasicException;

    AppUser findPeopleByName(String name) throws BasicException;

    String findRolePermissions(String sRole);

    String findVersion() throws BasicException;

    String getInitScript();
    
    byte[] getResource(String name);

    byte[] getResourceAsBinary(String sName);

    String getResourceAsText(String sName);

    String getResourceAsXML(String sName);

    int getSequenceCash(String host) throws BasicException;

    List<AppUserExt> listPeopleVisible() throws BasicException;

    void resetResourcesCache();

    void setResource(String name, int type, byte[] data);

    void setResourceAsBinary(String sName, byte[] data);

    String findRolePermissionsByAdvCode(String advCode);

     List<String> listResourceNameByType(int type) throws BasicException;

    String findRoleOrderTypePermissions(String sRole);

     List<Resource> listResourceByType(int type) throws BasicException;

    AppUser findPeopleByNumberAndPass(String number,String pass) throws BasicException;

	AppUser findPeopleById(String id) throws BasicException;

	AppUserState getAppUserState(String id)throws BasicException;
	
	public int insert(AppUserState state) throws BasicException;
    
	public int deleteAppUserState(String userId)throws BasicException;

	void clearUserRecord(String userId)throws BasicException;

	String findUserStateProcessPermissions(String m_sRole);

	Location findLocation(String m_sInventoryLocation)throws BasicException;
	
	AppUser findPeopleByIMSI(String imsi) throws BasicException;

	void closeCash(Date dNow, Date dNow2, String host, String userCashIndex) throws BasicException;
	
    
  
}
